<!doctype html>
<html><!-- InstanceBegin template="/Templates/cloud.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=640, initial-scale=0.5, minimum-scale=0.5, maximum-scale=0.5">
<!-- InstanceBeginEditable name="doctitle" -->
<title>智能云管家-业务订购</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="EditRegion-jscode" -->
<script src="resources/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="resources/appMobi-jQ.Mobi-3d025ab/plugins/jq.fx.js"></script>

<script type="text/javascript" src="resources/js/common.js"></script>
<script type="text/javascript">
var localStr=window.location.href;
$(function(){
    addEventListener("load", function() { setTimeout(hideURLbar, 0); }, false); 
	addEventListener("orientationchange", function() { setTimeout(hideURLbar, 0); }, false);
	addEventListener("load",function(){$("#loading").hide();
	$(".floatBoxBg").hide();});
      function hideURLbar(){ 
               window.scrollTo(0,1); 
      }
      if(navigator.userAgent.toLowerCase().indexOf("android", 0)<0){
         $("#footer").css({"center;z-index":"999","position":"fixed","bottom":"0"});
         window.scrollTo(0,1); 
        }else{
        $("#footer").css({"position":"fixed","bottom":"0"});
    var top = $("#footer").offset().top;
    if(localStr.indexOf("file:///",0)<0)
	{
	    $(window).scroll(function(){
	    $("#footer").offset({top:$(document).scrollTop()+top});
	    });
	}
        }

       }); 

$(document).ready(function() {
	logincheck();
	if(localStr.indexOf("file:///",0)<0&&detectDeviceType()=="Android"){
		$("#client").hide();
		$("#dlclient").show();
	}else{
		$("#client").show();
		$("#dlclient").hide();
	}
	

	var url=jsonserver+"business/busilist/busitype/"+getQueryParameter("busi_type");
	$.getJSON(url+".jsonp?callback=?",{},function(data){
		if(data==null){
			window.location.href='error.html?msg=0';
		}
		 $.each(data, function(i, field){
		$("#mainconfig").append('<div id='+field.busi_id+' style="height: 83px; background-image: url(resources/css/images/buybusiness/images/order_list_bg.png); font-size: 32px; padding-left:10px"><table width="100%" height="83px" border="0"><tr><td>'+field.busi_desc+'</td><td width="73px"><img  id='+field.busi_id+"openFlag"+' src="resources/css/images/buybusiness/images/up.png"/></td></tr></table></div><div id='+field.busi_id+"_det"+' style="height:162px; font-size:26px; line-height:50px; padding-left:10px; overflow:hidden"><table width="100%" height="162px" border="0"><tr><td rowspan="2" align="left" valign="top"><li style="list-style-type:none">资费：<span>'+field.busi_price+'</span>元/月</li><li style="list-style-type:none">生效方式：办理成功后即时生效</li><div id='+"ordertip"+field.busi_id+'></div></td><td width="135">&nbsp;</td></tr><tr><td height="81"><img  src="resources/css/images/buybusiness/images/order_btn.png" onclick="confirmation('+field.busi_id+')"/></td></tr></table></div>');
		var seclectedId=getQueryParameter("busi_id");
		if(seclectedId!=field.busi_id){
			$("#"+field.busi_id+"_det").hide();
			$("#"+field.busi_id+"openFlag").attr("src","resources/css/images/buybusiness/images/down.png");
		}
		$("#"+field.busi_id).bind("click",function(){upordown(field.busi_id);});
      });
	});
	if(localStorage.getItem("width")==null){
		localStorage.setItem("width",window.screen.width);
		localStorage.setItem("height",window.screen.height);
	}
	if(localStorage.getItem("width")>700) {
		$("meta").attr("content","width=device-width, initial-scale=0.6, minimum-scale=0.6, maximum-scale=0.6");
	}
	if(window.screen.height>window.screen.width){
		Vertical();
	}
	$( window ).bind( "orientationchange", function() {
		changeScreen();
		});
	$("#package1det").hide();
    $("#package1").bind("click",function(){
		if($("#package1det").get(0).style.display=="none"){
			$("#openFlag").attr("src","resources/css/images/buybusiness/images/up.png");
		}else{
			$("#openFlag").attr("src","resources/css/images/buybusiness/images/down.png");
		}
		$("#package1det").slideToggle();
	});
});
function changeScreen(){
	if(window.screen.height>window.screen.width){
		Vertical();
		} 
	else {
		$("#content").removeAttr("style");
		$("#mainconfig").removeAttr("style");
	}
	}
function Vertical(){
	var screenheigh = localStorage.getItem("height");
	if(screenheigh<=500){
		
	}
	else if(screenheigh>1100){
		$("#content").height(0.8*screenheigh);
		
	}
	else{
		$("#content").height(1.4*screenheigh);
		
	}
	}
function upordown(divId) {
	if($("#"+divId+"_det").get(0).style.display=="none"){
			$("#"+divId+"openFlag").attr("src","resources/css/images/buybusiness/images/up.png");
		}else{
			$("#"+divId+"openFlag").attr("src","resources/css/images/buybusiness/images/down.png");
		}
		$("#"+divId+"_det").slideToggle();
	}
function businessHandle(businessId){
		url=jsonserver+"business/handlebusi/phone/"+localStorage.getItem("curphone")+"/idlist/"+businessId;
		$.getJSON(url+".jsonp?callback=?",{},function(data){
			$("#ordertip"+businessId).append('<div id="ordertip" style="text-align:center; font-size:24px; color:red; padding-top:10px">'+data.sb.msg+'</div>');
		});
}  
	function getQueryParameter(qs)  
	{  
		var s = location.href;  
		//alert(s);
		s = s.replace("?","?&").split("&");//这样可以保证第一个参数也能分出来
		//alert(s); 
		var re = "";  
		for(i=1;i<s.length;i++)  
			if(s[i].indexOf(qs+"=")==0)  
				re = s[i].replace(qs+"=","");//取代前面的参数名，只剩下参数值  
				  
		return re;  
	} 
function confirmation(businessId) {
	var itop=(document.body.clientHeight )/2-100;
    var ileft=(document.body.clientWidth )/2-200;
	$("body").append('<div id="popup" class="floatBoxBg"></div>');
	var alertDiv='<div id="confirmwindow" style="background:url(resources/css/images/buybusiness/images/alert_bg.png) repeat-x;z-index:9999;border-radius:8px;text-align:center;font-size:34px;color:#010101;font-weight:bold;" ><table width="100%" height="238"><tr><td colspan="3">是否确定订购此业务?</td></tr><tr><td><img src="resources/css/images/buybusiness/images/order_yes.jpg" onClick="yes('+businessId+')"/></td><td width="4%"></td><td><img src="resources/css/images/buybusiness/images/order_no.jpg" onClick="no();"/></td></tr></table></div>';
	$("body").append(alertDiv);
	var o=$("#confirmwindow");
	o.css({
			width:"60%",
			height:"239px",
            position:"absolute",
            top:"250px",
            left:"21%"
        });
	} 
function yes(businessId){
	$("#confirmwindow").remove();
	$("#popup").remove();
	businessHandle(businessId);
	}
function no(){
	$("#confirmwindow").remove();
	$("#popup").remove();
	}
</script>

<link href="resources/css/load.css" rel="stylesheet" type="text/css">
<!-- InstanceEndEditable -->
<style type="text/css">
*{
	font-family:Heiti SC;
}
</style>
	<script type="text/javascript">
//var _bdhmProtocol = (("https:" == document.location.protocol) ? " https://" : " http://");
//document.write(unescape("%3Cscript src='" + _bdhmProtocol + "hm.baidu.com/h.js%3F2284c04845acdcd94dd640a8555927dc' type='text/javascript'%3E%3C/script%3E"));
</script>
</head>

<body style="margin:0;">

	<div id="header">
	<!-- InstanceBeginEditable name="EditRegion-header" -->
    <div style="width:100%; background-image:url(resources/css/images/top_bg.jpg); height:88px"><table width="100%" height="88px" border="0">
  <tr>
    <td style="width:18%; max-width:110px; padding-left:5px"><img src="resources/css/images/warning/images/fanhui.png" width="90%" style="max-width:99px" onClick="javascript:window.location.href='index.html'"/></td>
    <td style="text-align: center; font-size: 40px;">业务订购</td>
    <td width="18%" style="max-width:max-width:110px; padding-right:5px">&nbsp;</td>
  </tr>
</table>

    </div>
	<!-- InstanceEndEditable -->
    </div>
    <div id="content">
    <div id="loading" class="loading"><img src="resources/css/images/loading.gif"/>载入中...</div>
    <div class="floatBoxBg"></div>
	<!-- InstanceBeginEditable name="EditRegion-content" -->
    <div id="mainconfig">
    
    </div>
    <div style="margin-left:20px; color:#F63; font-size:32px">提示：可以同时订购不同的业务包</div>
     <div id="foot" style="font-size: 24px; max-height:80px; padding:10px; text-align:center; background-image:url(resources/css/images/bottom_share_bg.png)"><div id="foot" style="margin-left: 10px; font-size: 24px; width:100%"><table width="100%" border="0">
  <tr>
    <td width="15%"><div style="max-width:101px"><img src="resources/css/images/system/images/share_btn.png" width="100%" onClick="javascript:window.location.href='share.html'"/></div></td>
    <td><div id="dlclient" onClick="download()">下载云管家客户端，更多给力功能</div><div id="client">COOL！流量变化随时掌握</div></td>
  </tr>
</table>
</div>

   </div>

	<!-- InstanceEndEditable -->
    </div>
    <!-- InstanceBeginEditable name="EditRegion-footer" -->
	<!-- InstanceEndEditable -->
    <div id="footer">
    </div>
    
</body>
<!-- InstanceEnd --></html>
